<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'delete-comfirmation',
    'enableAjaxValidation' => false,
        ));
?>

<div id="request"/>
<div id="update-dialog-message-common" style="margin:15px 0 20px; text-align: center">
    <?php
    $url = $_SERVER['REQUEST_URI'];
    if (strpos($url, 'menu/publish') !== false) {
        echo t('MSG_CONFIRM_ACTION', 'messages', array('{0}' => 'publish'));
    } else if (strpos($url, 'menu/unpublish') !== false) {
        echo t('MSG_CONFIRM_ACTION', 'messages', array('{0}' => 'unpublish'));
    }
    ?>
</div>
<div id="update-dialog-buttons-common" style="text-align: center;">
    <?php
    echo Html::buttonConfirm(t('BTN_YES'), 'Confirmed');
    echo Html::buttonConfirm(t('BTN_NO'), 'Canceled', 'cancel');
    ?>
</div>
<script>
    if ($.fn.yiiGridView.getChecked("DataGrid","chkId").length == 0 ){
        var $url = "<?php echo $url ?>";
        if ($url.indexOf('menu/publish')!=-1) {
            $("#update-dialog-message-common").html('<?php echo t('MSG_REMIND_SELECT_ROW', 'messages', array('{0}' => 'publish')); ?>');
        } else if ($url.indexOf('menu/unpublish')!=-1) {
            $("#update-dialog-message-common").html('<?php echo t('MSG_REMIND_SELECT_ROW', 'messages', array('{0}' => 'unpublish')); ?>');
        }
        $("#update-dialog-buttons-common").html('<button type="button" id="btnOk" name="btnOk" class="button ok" onclick="$(&#039;#update-dialog&#039;).dialog(&#039;close&#039;)">OK</button>');
    }	
    
</script>
<?php $this->endWidget(); ?>